﻿using G04P1_LogikaBiznesowa;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace G03P1_Interface
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        Class1 clasa = new Class1(new NorthwindEntities("metadata=res://*/Grupa3Model.csdl|res://*/Grupa3Model.ssdl|res://*/Grupa3Model.msl;provider=System.Data.SqlClient;provider connection string=\";Data Source=TOMEK-KOMPUTER;Initial Catalog=Northwind;Integrated Security=True;MultipleActiveResultSets=True\""));
        
        public MainWindow()
        {
            InitializeComponent();
        }

        private void lblAbout_MouseDown(object sender, MouseButtonEventArgs e)
        {
            AboutWindow aw = new AboutWindow();
            aw.Show();
        }

        private void btnSearch_Click(object sender, RoutedEventArgs e)
        {
            dgEmployeesList.ItemsSource = clasa.ListaSprzedawcowNaPoziomie(Convert.ToInt32(txtLevel.Text));
            
        }

        private void Window_Closing_1(object sender, System.ComponentModel.CancelEventArgs e)
        {
            App.Current.Shutdown();
        }
    }
}
